﻿package mortal.game.net.command.group
{
    import Framework.MQ.*;
    import Message.DB.Tables.*;
    import com.mui.controls.*;
    import extend.language.*;
    import flash.display.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.net.broadCast.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.alertwins.*;
    import mortal.mvc.core.*;

    public class GroupCopyOpenCommand extends BroadCastCall
    {

        public function GroupCopyOpenCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            var tcopy:TCopy;
            var onCloseHandler:Function;
            var mb:* = param1;
            onCloseHandler = function (param1:int) : void
            {
                if (param1 == Alert.OK)
                {
                    if (Cache.instance.group.isInCopyGroup)
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CopyGroupEnter, tcopy.code));
                    }
                }
                return;
            }// end function
            ;
            Alert.mode = Alert.Mode_NoneNotModal;
            Alert.alertWinRenderer = TimerAlertWin;
            Alert.buttonWidth = 70;
            Alert.timerOut = 5;
            Alert.okLabel = Language.getString(70064);
            tcopy = CopyConfig.instance.getCopyInfoByCode(Cache.instance.group.sgroup.copyCode);
            if (tcopy == null)
            {
                return;
            }
            var alertWin:* = Alert.show(Language.getStringByParam(20503, tcopy.name), null, Alert.OK, null, onCloseHandler);
            return;
        }// end function

    }
}
